<?php (!defined('IN_SYSTEM') || !defined('ADMIN_PRE')) && exit('Access Denied!');?>
{admintemplate header}
<div class="box">
	<div class="heading">
	<h1>{l('Block Manage','block')}</h1>
	<div class="buttons">
	<a href="{url admin.php?m=block&f=index}" class="fr">{l('All Block','block')}</a>
	<a href="{url admin.php?m=block&f=add}" class="fr">{l('Add Block','block')}</a>
	<a href="{url admin.php?m=block&f=add}" class="fr current">{l('Content Manage','block')}</a>
	</div>
	</div>
	<div class="main">
	
	<div class="search">
			<form name="search" method="GET" action="{url admin.php?m=block&f=data}">
				<fieldset>
					<legend>{l('Search','block')}</legend>
						{l('Title','block')}：<input type="text" name="pname" size="35" value="{urldecode($pname)}" />
						 {l('Status','block')}：<select name="pstatus">
						<option  value="9">{l('All','block')}</option>
						{loop $status $k $v}
						<option {if $pstatus==$k}selected="selected"{/if} value="{$k}">{$v}</option>{/loop}</select>
						<input type="submit" name="s" class="button" value="{l('Search','block')}" />
				</fieldset>
			</form>
	</div>
	
	<form name="update" method="post" action="{url admin.php?m=block}">
			<table class="list" id="list" cellspacing="0">
				<thead>
				<tr>{if ican("blkdelete")}
					<td width="1">
 					<input type="checkbox" class="checkbox" value="1" name="chkall" onclick="check_all(this)" />
					</td>
					{/if}
					<td width="85">{l('Display Order','block')}</td>
					<td width="85">ID</td>
					<td>{l('Title','block')}</td>
					<td width="85">{l('Expiration','block')}</td>
					<td width="85">{l('Status','block')}</td>
					<td width="135">{l('Operation','block')}</td>
				</tr>
				</thead>
				<tbody>
				{loop $datas $row}
				<tr id="row_{$row['blockid']}">
				{if ican("blkdelete")}
					<td align="center"  width="1"><input type="checkbox" name="id[]" value="{$row['bdid']}" class="checkbox" /></td>
				{/if}
					<td><input type="text" size="3" name="listorder[{$row['bdid']}]" value="{$row['listorder']}"></td>
					<td>{$row['bdid']}</td>{php $rs=unserialize($row['data'])}
					<td><a href="{$rs['url']}" target="_blank">{$rs['title']}</a></td>
					<td>{if $row['expiration']>0}{gdate('Y-m-d H:i:s',$row['expiration'])}{/if}</td>
					<td>{if $row['status']}{l('Enable','block')}{else}{l('Disable','block')}{/if}</td>
					<td>
					{if ican("artedit")}
					<a href="{url admin.php?m=article&f=edit&id=$row[bdid]}">{l('Edit Source','block')}</a>
					{/if}
					{if ican("blkedit")}
					 | <a href="{url admin.php?m=block&f=data_add&blockid=$row[blockid]&id=$row[bdid]}">{l('Update','block')}</a>
					{/if}
					{if ican("blkdelete")}
					 | <a href="{url admin.php?m=block&f=data_delete&blockid=$row[blockid]&id=$row[bdid]}" onclick="return confirm('{l('Sure Delete?','block')}')">{l('Delete','block')}</a>
					{/if}
					</td>
				</tr>
				{/loop}
				<tr>
					<td><input type="checkbox" class="checkbox" value="1" name="chkall" onclick="check_all(this)" /></td>
					<td colspan="10"  class="left">
					<input type="hidden" name="blockid" value="{$id}"/>
					{if ican("blkedit")}
					<input type="radio" name="f" id="data_edit" value="data_edit" class="radio" /><label for="data_edit">{l('Update','block')}</label>
					{/if}
					{if ican("blkdelete")}
					<input type="radio" name="f" id="data_delete" value="data_delete" class="radio" /><label for="data_delete">{l('Delete','block')}</label>
					{/if}
					<input type="submit" class="button"  value="{l('Submit','block')}"/>
					{$page}
					</td>
				</tr>
				</tbody>
			</table>
	</form>
	</div>
</div>
{admintemplate footer}